<local:DocumentBase x:Class="WPFExcelReport.TSTWD02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                      xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:MU="clr-namespace:WPFExcelReport;assembly=TICC_ABAX" 
                    xmlns:AB52="clr-namespace:WPFExcelReport;assembly=TABAUFM" 
                    xmlns:EKK="clr-namespace:WPFExcelReport;assembly=TEKKOPF"  
                      xmlns:VKP="clr-namespace:WPFExcelReport;assembly=TVKPOS"  
                    xmlns:EK="clr-namespace:WPFExcelReport;assembly=TEKPOS"  
                    xmlns:AB="clr-namespace:WPFExcelReport;assembly=TABPOS"  
                    xmlns:WD="clr-namespace:WPFExcelReport;assembly=TWDECK"  
                   xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM"  
                    xmlns:U="clr-namespace:WPFExcelReport;assembly=ITXUI"  
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"  
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"                    
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                    xmlns:LS="clr-namespace:WPFExcelReport;assembly=TLIEFDAT"  
                     xmlns:me="clr-namespace:WPFExcelReport"
                    FontSize="14"
                    Name="TV"
                    Loaded="Window_Loaded"
>
    <local:DocumentBase.Resources>
        <ucd:BoolToVisibilityConverter x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTConverter  x:Key="not"/>
    </local:DocumentBase.Resources>
    <DockPanel>
        <ex:AniScrollViewer DockPanel.Dock="Right"  MaxWidth="300"
                            Visibility="{Binding IsShowRight,ElementName=TV,Converter={StaticResource bv}}"
                            >
            <StackPanel>
                <LS:TLS03 ORDERNUM="{Binding LIEFNR,ElementName=cWD02}" />
                <KD:TKD  Name="cKD"
                          ORDERNUM="{Binding KUNDNR,ElementName=cVKP}"   
                         />
            </StackPanel>
        </ex:AniScrollViewer>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <WrapPanel Grid.Row="0"  Visibility="{Binding KDBLOCK,ElementName=cKD,Converter={StaticResource bv}}">
                <TextBlock  
                            Margin="5"
                              Foreground="Red"
                            Text="{Binding Source={Localization:Translate Word=KDCREDITEXC}}"
                       />
                <TextBlock  
                            Margin="5"
                             Foreground="Red"
                            Text="{Binding VKBLOCK,ElementName=cKD}"
                       />
                <CheckBox Content="{Binding Source={Localization:Translate Word=关闭此提示}}"   Foreground="Red"
                            Margin="5,0,0,0"
                          IsChecked="{Binding KDBLOCK,ElementName=cKD,Converter={StaticResource not}}"/>

            </WrapPanel>
            <Grid Grid.Row="1" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition> 
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions> 
                <WD:TPWD02 Grid.Row="0"  
                       AUFART="K" 
                       VKBLOCK="{Binding VKBLOCK,ElementName=cKD}"
                       x:Name="cWD02" />
                <Grid Grid.Row="1" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="0">
                        <WD:TWDECK  FTMUREV="True" ORDERNUM="{Binding KEY,ElementName=cWD02}"/>
                        <AB52:TABAUFM Grid.Row="1" Grid.Column="1" FTMUREV="True"/>
                    </StackPanel>
                </Grid>
                <StackPanel Grid.Row="2" Grid.Column="0" Visibility="Collapsed" >
                    <VKP:TFVKP Grid.Row="0" 
                                 Name="cVKP"
                                 Visibility="{Binding IsVK,ElementName=cWD02,Converter={StaticResource bv}}"  
                                 ORDERNUM="{Binding KEY,ElementName=cWD02}"/>
                    <U:TTSTEKP Grid.Row="0" Grid.Column="1" 
                                 Visibility="{Binding IsEK,ElementName=cWD02,Converter={StaticResource bv}}" />

                </StackPanel>
                <Expander  Grid.Row="3"  Grid.Column="0" Grid.ColumnSpan="2" ExpandDirection="Down" IsExpanded="False">
                    <Expander.Header>
                        <WrapPanel>
                            <WF:TBTNEXE IsInfo="True" INFO="{Binding EKAUF,ElementName=cWD02}" CMD="EK02" DLL="TEKKOPF" STWNW="MainWindow"/> 
                        </WrapPanel>
                    </Expander.Header>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                            <ColumnDefinition Width="1*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>

                        <EKK:TEK04 Grid.Row="0" Grid.Column="0"   x:Name="cEKK"
                      IsChgLS="False"
                ORDERNUM="{Binding EKAUF,ElementName=cWD02}"
                  />
                        <U:TTSTEKP   Grid.Row="0" Grid.Column="1" Grid.RowSpan="2"  Name="cEK05" 
                            EXAUF="{Binding AUF,ElementName=cEKK}"
                            ARTST="F" IsPrice="True" MinWidth="200" MinHeight="50" />

                    </Grid> 

                </Expander>

            </Grid>
        </Grid>
    </DockPanel>
</local:DocumentBase>
    
